const fs = require('fs')
const path = require('path')


exports.getImg = (req, res) => {
  let arr = req.body

  let result = []

  arr.forEach(item => {
    const dir = path.join(__dirname, '../', item)
    const base64 = fs.readFileSync(dir, 'base64') // 转 base64
    base64.replace(/=+$/, '');
    result.push(base64)
  })
  res.send({
    code: 20000,
    data: result
  })
}